package com.ruoyi.common.core.domain.miniapp;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;


@Data
public class WxLoginUser implements UserDetails
{

    private Long id;

    private String nickName;

    private String avatar;

    private String openId;

    private String sex;

    private Long miniAppId;

    private String token;

    /**
     * 登录时间
     */
    private Long loginTime;

    /**
     * 过期时间
     */
    private Long expireTime;

    /**
     * 登录IP地址
     */
    private String ipaddr;

    /**
     * 登录地点
     */
    private String loginLocation;

    /**
     * 浏览器类型
     */
    private String browser;

    /**
     * 操作系统
     */
    private String os;

    public WxLoginUser()
    {
    }

    public WxLoginUser(MiniAppUser miniAppUser)
    {
        this.id = miniAppUser.getId();
        this.nickName = miniAppUser.getNickName();
        this.avatar = miniAppUser.getAvatar();
        this.openId = miniAppUser.getOpenId();
        this.sex = miniAppUser.getSex();
        this.miniAppId = miniAppUser.getMiniAppId();
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities()
    {
        return null;
    }

    @Override
    public String getPassword()
    {
        return null;
    }

    @Override
    public String getUsername()
    {
        return null;
    }

    @Override
    public boolean isAccountNonExpired()
    {
        return false;
    }

    @Override
    public boolean isAccountNonLocked()
    {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired()
    {
        return false;
    }

    @Override
    public boolean isEnabled()
    {
        return false;
    }
}
